<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录</title>
<script type="text/javascript" src="../res/js/jquery-1.4.3.js"></script>
<link href="../res/css/Login.css" rel="stylesheet" type="text/css">
</head>
<body style="background-image: url('../res/img/background.jpg'); background-repeat: no-repeat;">

	<div class="login">
		<h2>登录</h2>
		<form action="denglu" class="loginContent">
			<input type="text" name="LoginName" placeholder="请输入用户名"> 
			<input type="password" name="Password" placeholder="请输入密码">
			<input type="submit" onclick="loginClick()" value="登录">
			<input type="button" onclick="window.open('zhuce.jsp')" value="注册">
			<!--<button type="submit" onclick="loginClick()">登陆</button> -->
			<!--<button type="button" onclick="window.open('zhuce.jsp')">注册</button>-->
		</form>

		<script type="text/javascript">
			//触发登录事件
			function loginClick() {
				//异步数据交互
				$.ajax({
					url : "denglu",
					data : $("form").serialize(),
					success : function(data) {
						var obj = JSON.parse(data);
						alert('"输入的信息为"' + $("form").serialize());
						if (obj.code == 1) {
						/*	alert(obj.massage);*/
							window.open("about.html");
						} 
						else {
							alert("登录失败，请确认密码账号！");
						}
					}
				});
			}
		</script>
	</div>
</body>
</html>